QT       += core gui network  dbus KWindowSystem x11extras svg#webenginewidgets

greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

LIBS +=-lpthread
LIBS +=-lX11
LIBS +=-lukui-log4qt

CONFIG += c++11
CONFIG += link_pkgconfig
CONFIG += lrelease

#check Qt version
QT_VERSION = $$[QT_VERSION]
QT_VERSION = $$split(QT_VERSION, ".")
QT_VER_MAJ = $$member(QT_VERSION, 0)
QT_VER_MIN = $$member(QT_VERSION, 1)

# about widget version
VERSION = 1.1.0.5
DEFINES += APP_VERSION=\\\"$$VERSION\\\"

# 配置kysdk
PKGCONFIG += kysdk-qtwidgets kysdk-waylandhelper kysdk-alm kysdk-ukenv kysdk-log kysdk-diagnostics
INCLUDEPATH += \
       kabase/ \
       kabase/Qt

lessThan(QT_VER_MAJ, 5) | lessThan(QT_VER_MIN, 12) {
    message(Qt版本小于5.12)
}
else{
    message(Qt版本大于或等于5.12)
    CONFIG += resources_big
}

PKGCONFIG += gsettings-qt
PKGCONFIG += kysdk-qtwidgets

# The following define makes your compiler emit warnings if you use
# any Qt feature that has been marked deprecated (the exact warnings
# depend on your compiler). Please consult the documentation of the
# deprecated API in order to know how to port your code away from it.
DEFINES += QT_DEPRECATED_WARNINGS

# You can also make your code fail to compile if it uses deprecated APIs.
# In order to do so, uncomment the following line.
# You can also select to disable deprecated APIs only up to a certain version of Qt.
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0

SOURCES += \
    src/contact_page_style.cpp \
    src/customui/custom_list_widget.cpp \
    src/daemonipcdbus.cpp \
    src/dbusadaptor.cpp \
    src/file_item_init.cpp \
    src/guidance_page_style.cpp \
    src/iconBtn.cpp \
    src/imageutil.cpp \
    src/localInfo.cpp \
    src/main.cpp \
    src/mainwindow.cpp \
    src/menumodule.cpp \
    src/messagePageStyle.cpp \
    src/my_qlineedit.cpp \
    src/myclick_widget.cpp \
    src/navigatebar.cpp \
    src/smtpMailClient.cpp \
    src/submitBase.cpp \
    src/systeminfo_button.cpp \
    src/tabmenu_button.cpp \
    src/widget_parameter_class.cpp \
    src/xatom-helper.cpp \
    src/customui/customlabel.cpp \
    src/customui/custompushbutton.cpp \
    src/customui/customwidget.cpp \
    src/customui/uicommon.cpp \
    src/customui/common.cpp \
    src/intro_page_style.cpp \
    src/globaldata.cpp

HEADERS += \
    src/contact_page_style.h \
    src/customui/custom_list_widget.h \
    src/daemonipcdbus.h \
    src/dbusadaptor.h \
    src/file_item_init.h \
    src/guidance_page_style.h \
    src/highlight-effect.h \
    src/iconBtn.h \
    src/imageutil.h \
    src/localInfo.h \
    src/mainwindow.h \
    src/menumodule.h \
    src/messagePageStyle.h \
    src/my_qlineedit.h \
    src/myclick_widget.h \
    src/navigatebar.h \
    src/smtpMailClient.h \
    src/submitBase.h \
    src/systeminfo_button.h \
    src/tabmenu_button.h \
    src/widget_parameter_class.h \
    src/xatom-helper.h \
    src/customui/customlabel.h \
    src/customui/custompushbutton.h \
    src/customui/customwidget.h \
    src/customui/uicommon.h \
    src/customui/common.h \
    src/intro_page_style.h \
    src/globaldata.h

FORMS += \
    src/contact_page_style.ui \
    src/guidance_page_style.ui \
    src/mainwindow.ui \
    src/messagePageStyle.ui \
    src/intro_page_style.ui

TRANSLATIONS += ./translations/kylin-service-support_zh_CN.ts
TRANSLATIONS += ./translations/kylin-service-support_bo_CN.ts


TARGET = kylin-service-support
message("产生ts文件"$$system(./translations/generate_translations_ts.sh))
message("产生qm文件"$$system(./translations/generate_translations_qm.sh))

# translations
TRANSLATIONS += $$PWD/translations/kylin-service-support_zh_CN.ts 
TRANSLATIONS += $$PWD/translations/kylin-service-support_kk.ts 
TRANSLATIONS += $$PWD/translations/kylin-service-support_ky.ts 
TRANSLATIONS += $$PWD/translations/kylin-service-support_ug.ts 
TRANSLATIONS += $$PWD/translations/kylin-service-support_bo_CN.ts
TRANSLATIONS += $$PWD/translations/kylin-service-support_zh_HK.ts 
QM_FILES_INSTALL_PATH = /usr/share/kylin-service-support/translations/

BEFORE_LINK_CMD_LINE = echo Hello world!
QMAKE_PRE_LINK += $$quote($$BEFORE_LINK_CMD_LINE)

target.path = /usr/bin
target.source += $$TARGET
icon.path = /usr/share/pixmaps
icon.files = kylin-service-support
desktop.path = /usr/share/applications/
desktop.files = kylin-service-support.desktop
translationsFiles.path = /usr/share/kylin-service-support/translations/
translationsFiles.files += $$PWD/translations/*
manual.path = /usr/share/kylin-user-guide/data/guide/Services-and-Supports
manual.files += $$PWD/data/Services-and-Supports/*
key.path =/usr/share/kylin-service-support/
key.files += $$PWD/data/kylin-service-support-key.conf
schemes.path = /usr/share/glib-2.0/schemas/
schemes.files += $$PWD/data/org.ukui.log4qt.kylin-service-support.gschema.xml

INSTALLS += target \
            icon \
            desktop \
            translationsFiles \
            manual  \
            schemes \
            key

DISTFILES +=

RESOURCES += \
    data.qrc
